package main;

import model.InorderTraversal;
import model.NamedTreeNode;
import model.PostOrderTraversal;
import model.PreOrderTraversal;

public class Runner{
	NamedTreeNode person;
		NamedTreeNode employee;
			NamedTreeNode sales_rep;
			NamedTreeNode engineer;
	
	NamedTreeNode customer;
		NamedTreeNode us_customer;
			NamedTreeNode local_customers;
			NamedTreeNode regional_customers;
		NamedTreeNode non_us_customer;
	
	
	@SuppressWarnings("unchecked")
	public Runner() throws Exception{
		person 				=	new NamedTreeNode("person");
		employee			=	new NamedTreeNode("employee");
		sales_rep			=	new NamedTreeNode("sales_rep");
		engineer			=	new NamedTreeNode("engineer");
			
		customer			=	new NamedTreeNode("customer");
		us_customer			=	new NamedTreeNode("us_customer");
		local_customers		=	new NamedTreeNode("local_customers");
		regional_customers	=	new NamedTreeNode("regional_customers");
		non_us_customer		=	new NamedTreeNode("non_us_customers");
		
		person.addChild(employee);
		person.addChild(customer);
		
		employee.addChild(sales_rep);
		employee.addChild(engineer);
		
		customer.addChild(us_customer);
		customer.addChild(non_us_customer);
		
		us_customer.addChild(local_customers);
		us_customer.addChild(regional_customers);
		
		InorderTraversal inOrder = new InorderTraversal(person);
		inOrder.traverse();
		
		System.out.println();
		System.out.println("Switching to PreOrderTraversal.");
		System.out.println();
		
		PreOrderTraversal preOrder = new PreOrderTraversal(person);
		preOrder.traverse();
		
		System.out.println();
		System.out.println("Switching to PostOrderTraversal.");
		System.out.println();
		
		PostOrderTraversal postOrder = new PostOrderTraversal(person);
		postOrder.traverse();
		
		
		
		
		
		
		
		
		
		
		
	}
}
